﻿@using MvcPaging
@model MvcPaging.IPagedList<TuanAnhPersonalWeb.Models.ContentModel>

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            CONTENT_TITLE
        </th>

        <th>
            CREATEDATE
        </th>
      
        <th>
            SHORT_CONTENT
        </th>
        <th>
            TYPE
        </th>
        <th>
            IMAGE_DIR
        </th>
       
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.CONTENT_TITLE)
        </td>
      
   
        <td>
               @String.Format("{0:dd/MM/yyyy}", item.CREATEDATE)
        </td>
      
        <td>
            @Html.DisplayFor(modelItem => item.SHORT_CONTENT)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TYPE)
        </td>
        <td>
        <img src=@item.IMAGE_DIR width="100px" height="100px"/>
        </td>
        
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.CONTENT_ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.CONTENT_ID }) ||
            @Html.ActionLink("Update Date","updateDate",new { id=item.CONTENT_ID}) |
        </td>
    </tr>
}

</table>
<div class="pager">
  @Ajax.Pager(ViewData.Model.PageSize, ViewData.Model.PageNumber, ViewData.Model.TotalItemCount, new { controller = "Content", action = "Search", keySearch = ViewData["keySearch"], valSearch = ViewData["valSearch"], TYPE_ID = ViewData["TypeID"] }, new AjaxOptions { UpdateTargetId = "divGrid", OnBegin = "beginPaging", OnSuccess = "successPaging" })
 </div>
